package com.example.enginetestandroid.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import com.example.enginetestandroid.R;
import com.example.enginetestandroid.widget.CommonTitleBar;

public class DetailActivity extends AppCompatActivity {

    private CommonTitleBar titleBar;
    private TextView contentTV;
    private String content = "";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);
        initTitleBar();
        initView();
    }

    private void initTitleBar() {
        titleBar = findViewById(R.id.title_view);
        titleBar.setTitleView("原生页面 - 详情");

        titleBar.setOnClickListener(new CommonTitleBar.OnclickListener() {
            @Override
            public void clickLeft() {
                finish();
            }

            @Override
            public void clickRight() {

            }
        });
    }

    private void initView() {
        contentTV = findViewById(R.id.tv_detail_content);

        Intent intent = getIntent();
        content = intent.getStringExtra("content");
        contentTV.setText(content);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        System.out.println("onDestroy - AboutActivity");
    }

}
